<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=7" /> 
	<title>测试a的href和click</title>
	
	<script src="xxx.js"></script>
</head>
<body><div id="content">
	<a href="#" onclick="alert(1);">href="#"</a><br />
	<a href="#top" onclick="alert(2);">href="top"</a><br />
	<a href="javascript:void(0);" onclick="alert(3);">href="javascript:void(0);"</a><br />
	<a href="javascript:;" onclick="alert(4);">href="javascript:;"</a><br />
	<a href="http://www.baidu.com" onclick="alert(5);">href="http://www.baidu.com" with no return false;</a><br />
	<a href="http://www.baidu.com" onclick="alert(6);return false;">href="http://www.baidu.com" with return false;</a><br />
	<a href="http://www.baidu.com" id="a7" target="_blank">href="http://www.baidu.com" return false;</a><br />

	<!-- IE6下的GIF动画不转了： -->
	<!--img src="http://www.qqtu.com/g/2009/140/39026.gif" />
	<img src="http://www.qqqinglv.com/qqshantu/upimg/allimg/080626/0845270.gif" /-->
	<!--<img src="http://www.qqzyz.net/upload/201003/qqzyz31312201003270017161.gif" />-->
	<!--img src="http://fzlsalon.com/uploads/100620/1_113242_1.gif" /-->

	<div>
	<h3>结论：</h3>
	<p>  </p>
	</div>
	
	
	</div>
	<script>
		function g(id){return document.getElementById(id);}
		window.onbeforeunload = function(){alert("onbeforeunload");}
		g("a7").onclick = function(e){
			//e.preventDefault();
			return false;
			/*if(window.event){
				event.returnValue = false;
			}else{
				e.preventDefault();
			}*/
		};
		jQuery("#content a")
	</script>
</body>
</html>